using NUnit.Framework;
using Tycho.Parser.Peg;

namespace Tycho.Parser.Tests.Peg {
    [TestFixture]
    public class TranslateEscapeCharacterSpecification {
        [Test]
        public void ShouldTranslateNormalCharacters () {
            AssertEscapeCharacter ('\t', 't');
            AssertEscapeCharacter ('\n', 'n');
            AssertEscapeCharacter ('\r', 'r');
            AssertEscapeCharacter ('"', '"');
            AssertEscapeCharacter ('\'', '\'');
        }

        private void AssertEscapeCharacter (char result, char escape) {
            Assert.AreEqual (result, InterpolatedStringProduction.TranslateEscapeCharacter (escape));
        }
    }
}